import { createRouter, createWebHistory } from 'vue-router'
import * as hooks from './hooks'


import routes from './common'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

for (let key in hooks){
  router.beforeEach(hooks[key as keyof typeof hooks])
}

export default router
